package com.yuanfengerp.basicInfoManage.svipinfo.contorller;

import com.yuanfengerp.basicInfoManage.svipinfo.model.Memberinfo;
import com.yuanfengerp.basicInfoManage.svipinfo.service.impl.MenmberinfoImpl;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class MemberinfoCon {
    @Autowired
    MenmberinfoImpl mbif;

    @PostMapping("/selectMemberAll")
    public Result<List<Memberinfo>> selectMemberAll(@RequestBody Map<String,Object> params){
//        System.out.println(new Date());
        return mbif.selectMemberAll(params);
    }

    @PostMapping("/selectMember")
    public Result<Memberinfo> selectMember(String id){
        return mbif.selectMember(id);
    }

    @PostMapping("/addMember")
    public Result<String> addMember(@RequestBody Memberinfo memberinfo){
        return mbif.addMember(memberinfo);
    }

    @PostMapping("/updateMember")
    public Result<String> updateMember(@RequestBody Memberinfo memberinfo){
//        System.out.println(memberinfo.getMember_name());
        return mbif.updateMember(memberinfo);
    }
}
